var dom = document.getElementById("container");
var myChart = echarts.init(dom);

option = null;
option = {
    title: {
        text: '产品组成构比',
        left: 'center'
    },
    tooltip: {
        trigger: 'item',
        formatter: "{a} <br/>{b} : {c} ({d}%)"
    },
    legend: {
        // orient: 'vertical',
        // top: 'middle',
        bottom: 10,
        left: 'center',
        data: ['781757', '811114', '761436', '电感1', '电感2']
    },
    series: [
        {
            type: 'pie',
            radius: '65%',
            center: ['50%', '50%'],
            selectedMode: 'single',
            data: [
                {
                    value: 1548,
                    name: '781757'
                },
                {
                    value: 535,
                    name: '811114'
                },
                {
                    value: 510,
                    name: '761436'
                },
                {
                    value: 634,
                    name: '电感1'
                },
                {
                    value: 735,
                    name: '电感2'
                }
            ],
            itemStyle: {
                emphasis: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
            }
        }
    ]
};
if (option && typeof option === "object") {
    myChart.setOption(option, true);
}
